package site.zhangzhuo.learn_springboot.profileConditional;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

@Configuration
public class LibraryConfiguration {

    /**
     * 通过注释或取消注释librarian方法，来改变Librarian bean的存在状态，从而观察对Library bean创建的影响。
     *
     * @return
     */


    @Bean
    public Librarian3 librarian3() {
        return new Librarian3();
    }


    @Bean
    @Conditional(LibrarianCondition.class)
    public Library3 library3() {
        return new Library3("The Great Library");
    }
}
